package com.example.mybatisplusdemo.model.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 记录积分变化
 * </p>
 *
 * @author lqj
 * @since 2025-07-02
 */
@TableName("points_history")
@ApiModel(value="PointsHistory对象", description="记录积分变化")
public class PointsHistory implements Serializable {

    private static final long serialVersionUID = 1L;

        @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

        @ApiModelProperty(value = "用户表_主键")
    @TableField("user_id")
    private Long userId;

        @ApiModelProperty(value = "积分变动值")
    @TableField("points")
    private Integer points;

        @ApiModelProperty(value = "变动类型")
    @TableField("change_type")
    private Integer changeType;

        @ApiModelProperty(value = "来源ID")
    @TableField("source_id")
    private Long sourceId;

        @ApiModelProperty(value = "逻辑删除")
    @TableField("is_deleted")
        @TableLogic
    private Boolean deleted;

        @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

        @ApiModelProperty(value = "修改时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

        public Long getId() {
        return id;
        }

            public PointsHistory setId(Long id) {
        this.id = id;
            return this;
        }
        public Long getUserId() {
        return userId;
        }

            public PointsHistory setUserId(Long userId) {
        this.userId = userId;
            return this;
        }
        public Integer getPoints() {
        return points;
        }

            public PointsHistory setPoints(Integer points) {
        this.points = points;
            return this;
        }
        public Integer getChangeType() {
        return changeType;
        }

            public PointsHistory setChangeType(Integer changeType) {
        this.changeType = changeType;
            return this;
        }
        public Long getSourceId() {
        return sourceId;
        }

            public PointsHistory setSourceId(Long sourceId) {
        this.sourceId = sourceId;
            return this;
        }
        public Boolean getDeleted() {
        return deleted;
        }

            public PointsHistory setDeleted(Boolean deleted) {
        this.deleted = deleted;
            return this;
        }
        public LocalDateTime getCreateTime() {
        return createTime;
        }

            public PointsHistory setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
            return this;
        }
        public LocalDateTime getUpdateTime() {
        return updateTime;
        }

            public PointsHistory setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
            return this;
        }

    @Override
    public String toString() {
    return "PointsHistory{" +
            "id=" + id +
            ", userId=" + userId +
            ", points=" + points +
            ", changeType=" + changeType +
            ", sourceId=" + sourceId +
            ", deleted=" + deleted +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
    "}";
    }
}
